import {createStore,applyMiddleware} from 'redux';
import {composeWithDevTools} from 'redux-devtools-extension';
import {persistStore, persistReducer} from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import thunk from "redux-thunk";
import reducer from './reducer';



const persistConfig = {
    key: 'root',
    storage,
    blacklist:[]  //设置某个reducer数据不持久化，
}

const myPersistReducer = persistReducer(persistConfig, reducer)
const store = createStore(myPersistReducer, composeWithDevTools(applyMiddleware(thunk)));
const persistor = persistStore(store)
export default store;
export {persistor}